package thread;
class MyThread extends Thread {
    @Override
    public void run() {
        // 这个代码中,如果想要获取到线程的引用,直接使用 this 即可
        System.out.println(this.getId() + ", " + this.getName());
    }
}
public class ThreadDemo16 {
    public static void main(String[] args) {
        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();
        t1.start();
        t2.start();
    }
}
